package com.yst.webplugin.annotation;


import com.yst.executor.Page;

import java.lang.annotation.*;
import java.util.List;

/**
 * Single table query
 */
@ResultType(resultTypes = {Page.PageOut.class, List.class})
@Target({ElementType.FIELD,ElementType.ANNOTATION_TYPE})
@RequestParamClass(useModelClass = false,paramClass = FilterGroup.class)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface QueryTable {
    /**
     * class of entity
     *
     * @return
     */
    Class<?> modelClass() default Default.class;

    /**
     * unselect field
     * @return
     */
    String[] disableFields() default {};

    /**
     * select field list
     * @return
     */
    String[] selectedFields() default {};

    /**
     * name of page parameter
     * @return
     */
    String pageParamKey() default "page";

    /**
     * filter
     * @return
     */
    Filter[] filters() default {};

    /**
     * grow [field] desc|asc
     * @return
     */
    String orderBy() default "";

}
